package com.jxufe.weather;

import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;

import org.apache.hadoop.io.Writable;

public class WeaStatBean implements Writable {
	private int cityid;
	private Double tem;
	
	private Double maxLowTem;
	private Double minLowTem;
	private Double averLowTem;
	
	private Double maxHighTem;
	private Double minHighTem;
	private Double averHighTem;

	public WeaStatBean() {
		super();
	}

	public WeaStatBean(int cityid, Double tem, Double maxLowTem, Double minLowTem, Double averLowTem, Double maxHighTem,
			Double minHighTem, Double averHighTem) {
		super();
		this.cityid = cityid;
		this.tem = tem;
		this.maxLowTem = maxLowTem;
		this.minLowTem = minLowTem;
		this.averLowTem = averLowTem;
		this.maxHighTem = maxHighTem;
		this.minHighTem = minHighTem;
		this.averHighTem = averHighTem;
	}


	public void write(DataOutput out) throws IOException {
		out.writeInt(cityid);
		out.writeDouble(tem);
		
		out.writeDouble(maxLowTem);
		out.writeDouble(minLowTem);
		out.writeDouble(averLowTem);
		
		out.writeDouble(maxHighTem);
		out.writeDouble(minHighTem);
		out.writeDouble(averHighTem);
	}

	public void readFields(DataInput in) throws IOException {
		this.cityid = in.readInt();
		this.tem = in.readDouble();
		
		this.maxLowTem = in.readDouble();
		this.minLowTem = in.readDouble();
		this.averLowTem = in.readDouble();
		
		this.maxHighTem = in.readDouble();
		this.minHighTem = in.readDouble();
		this.averHighTem = in.readDouble();
	}

	public int getCityid() {
		return cityid;
	}

	public void setCityid(int cityid) {
		this.cityid = cityid;
	}

	public Double getTem() {
		return tem;
	}

	public void setTem(Double tem) {
		this.tem = tem;
	}

	public Double getMaxLowTem() {
		return maxLowTem;
	}

	public void setMaxLowTem(Double maxLowTem) {
		this.maxLowTem = maxLowTem;
	}

	public Double getMinLowTem() {
		return minLowTem;
	}

	public void setMinLowTem(Double minLowTem) {
		this.minLowTem = minLowTem;
	}

	public Double getAverLowTem() {
		return averLowTem;
	}

	public void setAverLowTem(Double averLowTem) {
		this.averLowTem = averLowTem;
	}

	public Double getMaxHighTem() {
		return maxHighTem;
	}

	public void setMaxHighTem(Double maxHighTem) {
		this.maxHighTem = maxHighTem;
	}

	public Double getMinHighTem() {
		return minHighTem;
	}

	public void setMinHighTem(Double minHighTem) {
		this.minHighTem = minHighTem;
	}

	public Double getAverHighTem() {
		return averHighTem;
	}

	public void setAverHighTem(Double averHighTem) {
		this.averHighTem = averHighTem;
	}

	@Override
	public String toString() {
		return "WeaStatBean [cityid=" + cityid + ", tem=" + tem + ", maxLowTem=" + maxLowTem + ", minLowTem="
				+ minLowTem + ", averLowTem=" + averLowTem + ", maxHighTem=" + maxHighTem + ", minHighTem=" + minHighTem
				+ ", averHighTem=" + averHighTem + "]";
	}
	
	

}
